<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>3.事件修饰符</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../js/vue.js"></script>
    <style>
      .wraper {
        background-color: skyblue;
        padding: 20px;
      }
    </style>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <h2>欢迎来到{{school}}</h2>

      <form action="https://www.baidu.com">
        <button @click.prevent="showInfo">点我提示信息</button>
      </form>
      <hr>

      <div @click="showInfo" class="wraper">
        <button @click.stop="showInfo">点我提示信息</button>
      </div>
      <hr>

      <button @click.once="showInfo">点我提示信息（事件只能触发一次）</button>
      <hr>

      <div @click="showInfo" class="wraper">
        <a href="https://www.baidu.com" @click.prevent.stop.once="showInfo">点我提示信息</a>
      </div>


    </div>

    <script type="text/javascript">
      new Vue({
        el:'#demo',
        data:{
          school:'尚硅谷'
        },
        methods:{
          showInfo(event){
            alert('你好啊！')
          }
        }
      })
    </script>
  </body>
</html>